<?php if (!defined('THINK_PATH')) exit();?><!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>登陆</title>
<link href="/Public/Home/cssbase.css" rel="stylesheet" type="text/css">
<link href="/Public/Home/css/css.css" rel="stylesheet" type="text/css">
<link href="/Public/static/bootstrap/css/bootstrap.css" rel="stylesheet">
<link href="/Public/static/bootstrap/css/bootstrap-responsive.css" rel="stylesheet">
<link href="/Public/static/bootstrap/css/docs.css" rel="stylesheet">
<link href="/Public/static/bootstrap/css/onethink.css" rel="stylesheet">
</head>

<div class="login-top">
    <div class="wrapper">
        <div class="fl font30" style="margin: auto; "><a href="<?php echo U('Index/index');?>"><h4>首页</h4></a></div>
        <div class="fr">您好，欢迎为生活充电在线！</div>
    </div>
</div>
<div class="l_main">
	<div class="span12">
     <div style="position: absolute; left:200px; top: 180px;">
        <form class="conlist"  action="/Home/User/login.html" method="post">

          <div class="control-group">
            <label class="control-label" for="inputEmail">用户名</label>
            <div class="controls">
              <input type="text" id="inputEmail" class="loginusername" ajaxurl="/member/checkUserNameUnique.html" errormsg="请填写1-16位用户名" nullmsg="请填写用户名" datatype="*1-16" value="" name="username">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="inputPassword">密码</label>
            <div class="controls">
              <input type="password" id="inputPassword"  class="loginuserpassword   errormsg="密码为6-20位" nullmsg="请填写密码" datatype="*6-20" name="password">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label" for="inputPassword">验证码</label>
            <div class="controls">
              <input type="text" id="inputPassword" class="loginusername"   errormsg="请填写5位验证码" nullmsg="请填写验证码" datatype="*5-5" name="verify">
            </div>
          </div>
          <div class="control-group">
            <label class="control-label"></label>
            <div class="controls">
                <img src="<?php echo U('verify');?>" alt="" onclick="this.src=this.src+'?'+Math.random()">
                <!-- <img class="verifyimg reloadverify" alt="点击切换" src="<?php echo U('verify');?>" style="cursor:pointer;"> -->
            </div>
            <div class="controls Validform_checktip text-warning"></div>
          </div>
          <div class="control-group">
            <div class="controls">
              <button type="submit" class="loginbtn">登 陆</button>

            <div class="container">
              <p>
              <span>
              <span class="pull-left">
              <span>还没有账号? <a href="<?php echo U('User/register');?>">立即注册</a></span> </span></p>
            </div>

            </div>
          </div>
        </form>
        </div>
	</div><div class="fr margin-r100 margin-t45"><img src="/Public/Home/images/login-pic.jpg" width="507" height="300" style="position: absolute; right:100px; top: 165px;"></div>
</div>

 

	<script type="text/javascript">

    	$(document)
	    	.ajaxStart(function(){
	    		$("button:submit").addClass("log-in").attr("disabled", true);
	    	})
	    	.ajaxStop(function(){
	    		$("button:submit").removeClass("log-in").attr("disabled", false);
	    	});
    	$("form").submit(function(){
    		var self = $(this);
    		$.post(self.attr("action"), self.serialize(), success, "json");
    		return false;
    		function success(data){
    			if(data.status){
    				window.location.href = data.url;
    			} else {
    				self.find(".Validform_checktip").text(data.info);
    				//刷新验证码
    				$(".reloadverify").click();
    			}
    		}
    	});
		$(function(){
			var verifyimg = $(".verifyimg").attr("src");
            $(".reloadverify").click(function(){
                if( verifyimg.indexOf('?')>0){
                    $(".verifyimg").attr("src", verifyimg+'&random='+Math.random());
                }else{
                    $(".verifyimg").attr("src", verifyimg.replace(/?.*$/,'')+'?'+Math.random());
                }
            });
		});
	</script>